<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>后台管理</title>

		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->

		<!-- text fonts -->
		<link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
		<![endif]-->
		<link rel="stylesheet" href="assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="assets/js/html5shiv.min.js"></script>
		<script src="assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body class="no-skin">
		<div id="navbar" class="navbar navbar-default          ace-save-state">
			<div class="navbar-container ace-save-state" id="navbar-container">
				<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
					<span class="sr-only">Toggle sidebar</span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>
				</button>

				<div class="navbar-header pull-left">
					<a href="index.html" class="navbar-brand">
						<small>
							<i class="fa fa-leaf"></i>
							华夏医院管理后台
						</small>
					</a>
				</div>


			</div><!-- /.navbar-container -->
		</div>

		<div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
				try{ace.settings.loadState('main-container')}catch(e){}
			</script>

			<div id="sidebar" class="sidebar                  responsive                    ace-save-state">
				<script type="text/javascript">
					try{ace.settings.loadState('sidebar')}catch(e){}
				</script>

				<div class="sidebar-shortcuts" id="sidebar-shortcuts">
					<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
						<button class="btn btn-success">
							<i class="ace-icon fa fa-signal"></i>
						</button>

						<button class="btn btn-info">
							<i class="ace-icon fa fa-pencil"></i>
						</button>

						<button class="btn btn-warning">
							<i class="ace-icon fa fa-users"></i>
						</button>

						<button class="btn btn-danger">
							<i class="ace-icon fa fa-cogs"></i>
						</button>
					</div>

					<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
						<span class="btn btn-success"></span>

						<span class="btn btn-info"></span>

						<span class="btn btn-warning"></span>

						<span class="btn btn-danger"></span>
					</div>
				</div><!-- /.sidebar-shortcuts -->

				<ul class="nav nav-list">
					<li class="">
						<a href="index.html">
							<i class="menu-icon fa fa-tachometer"></i>
							<span class="menu-text"> 医院主页 </span>
						</a>

						<b class="arrow"></b>
					</li>

				</ul>
					</div>
			<div style="margin-left: 680px" id="wrap">
				<img src="img/tubiao.png" style="width: 300px;height: 130px">
				<span class="input-group-btn">
						<select class="form-control" style="position: absolute;width: 150px;margin-left: -240px;margin-top: 30px" v-model="flag">
						  <option value=1>药物</option>
						  <option value=2>器械</option>
						  <option value=3>案例</option>
						</select>
				<form action="#" target="_blank" style="margin-top: 30px">
				<!--
                    将两个元素整合为一体需要下面两步~
                    1.将div的Class属性改变成form-inline 可以让下面的两个input并排显示-->
				<div class="form-inline input-group">
					<!--UTF-8编码-->
					<input name=ie type=HIDDEN value=utf-8/>
					<input name=tn type=HIDDEN value=baidu/>
					<!--2.利用span标签的 input-group-btn 属性包裹一个input元素-->
                        <!-- baiduSug:
                            当设置baiduSug=1时，用户选中sug词条时默认执行表单提交动作；
                            当设置baiduSug=2时，用户选中sug词条时不执行表单提交动作。

                            style :     "width:260px;" 调整搜索框长度
                        -->
                        <input id="kw" type="text" class="form-control" placeholder="搜你想搜的" name="word" size="30" baiduSug="1" style="width:440px;margin-left: -90px" v-model="word">
						<!--提交按钮-->
                        <input type="button"  class="btn btn-default"  value="搜索一下" style="height: 35px"@click="findAll(flag,word)"/>

				</div>
			</form>
				</span>
				<div class="row" :style="{display:show1,margin:'30px 50px 0px 0px',marginLeft:'-300px'}">
					<div class="col-xs-12">
						<table class="table table-bordered table-hover" id="simple-table" >
							<thead>
							<tr class="table_header">
								<td>
									编号
								</td>
								<td>
									名称
								</td>
								<td>
									存储
								</td>
								<td>
									简介
								</td>
								<td>
									用法
								</td>


							</tr>
							</thead>
							<tbody>
							<tr v-for="(emp,index) in drugs" :key="emp.id" :class="index%2==0?'row1':'row2'">
								<td>
									{{ emp.id }}
								</td>
								<td>
									{{ emp.name }}
								</td>

								<td>
									{{ emp.storage }}
								</td>
								<td>
									{{ emp.telspecification }}
								</td>

								<td>
									{{ emp.useage }}
								</td>


							</tr>
							</tbody>
						</table>
						<!--<a href="http://localhost:8080/es_healthy/updateDoctor.html?id=13"class="btn btn-primary active"  aria-pressed="false">22222</a>-->
					</div>
					</div>
				<div class="row" :style="{display:show2,margin:'30px 50px 0px -300px'}" >
					<div class="col-xs-12">
						<table class="table table-bordered table-hover" id="1simple-table" >
							<thead>
							<tr class="table_header">
								<td>
									编号
								</td>
								<td>
									名称
								</td>
								<td>
									规格
								</td>
								<td>
									简介
								</td>
								<td>
									用法
								</td>


							</tr>
							</thead>
							<tbody>
							<tr v-for="(emp,index) in devices" :key="emp.id" :class="index%2==0?'row1':'row2'">
								<td>
									{{ emp.id }}
								</td>
								<td>
									{{ emp.name }}
								</td>

								<td>
									{{ emp.telspecification }}
								</td>
								<td>
									{{ emp.directions }}
								</td>
								<td>
									{{ emp.useage }}
								</td>


							</tr>
							</tbody>
						</table>
						<!--<a href="http://localhost:8080/es_healthy/updateDoctor.html?id=13"class="btn btn-primary active"  aria-pressed="false">22222</a>-->
					</div>
				</div>
				<div class="row" :style="{display:show3,margin:'30px 50px 0px -300px'}" id="drug">
					<div class="col-xs-12">
						<table class="table table-bordered table-hover" id="simple-table2" >
							<thead>
							<tr class="table_header">
								<td>
									编号
								</td>
								<td>
									名称
								</td>
								<td>
									症状描述
								</td>
								<td>
									诊断建议
								</td>



							</tr>
							</thead>
							<tbody>
							<tr v-for="(emp,index) in libraries" :key="emp.id" :class="index%2==0?'row1':'row2'">
								<td>
									{{ emp.id }}
								</td>
								<td>
									{{ emp.name }}
								</td>

								<td>
									{{ emp.directions }}
								</td>
								<td>
									{{ emp.advice }}
								</td>




							</tr>
							</tbody>
						</table>
						<!--<a href="http://localhost:8080/es_healthy/updateDoctor.html?id=13"class="btn btn-primary active"  aria-pressed="false">22222</a>-->
					</div>
				</div>
				<div class="row" >
					<div class="col-xs-6">
					</div>
					<div class="col-xs-6" style="margin-top:10px;margin-left: 180px;width:500px">

						<a class="btn"href="javascript:;" v-for="indexpage in totalPage"@click="findAll(indexpage)" v-text="indexpage">&nbsp;1</a>&nbsp;&#x0020;

					</div>
				</div>
			</div>


						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->

			<div class="footer">
				<div class="footer-inner">
					<div class="footer-content">
						<span class="bigger-120">
							<span class="blue bolder">Ace</span>
							Application &copy; 2013-2014
						</span>

						&nbsp; &nbsp;
						<span class="action-buttons">
							<a href="#">
								<i class="ace-icon fa fa-twitter-square light-blue bigger-150"></i>
							</a>

							<a href="#">
								<i class="ace-icon fa fa-facebook-square text-primary bigger-150"></i>
							</a>

							<a href="#">
								<i class="ace-icon fa fa-rss-square orange bigger-150"></i>
							</a>
						</span>
					</div>
				</div>
			</div>

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script src="assets/js/jquery-2.1.4.min.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->

		<!-- ace scripts -->
		<script src="assets/js/ace-elements.min.js"></script>
		<script src="assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->
	</body>
	<script src="/es_healthy/js/vue.js"></script>
	<script src="/es_healthy/js/axios.min.js"></script>
	<script>
		var app = new Vue({
			el:"#wrap",
			data:{
				flag:0,
				list:[],
				word:"",
				drugs:[],//用来存放员工信息
				page:0,
				rows:4,
				totalPage:0,
				totals:0,
				libraries:[],
				show1:"none",
				show2:"none",
				show3:"none",
				show:"none",
				devices:[]
			},
			methods:{
				//查询预约列表方法
				findAll(){
					var _this = this;
					this.status="block";
					axios.get("http://localhost:8080/es_healthy/doctor/search?id="+this.flag+"&word="+this.word+"&page="+this.page+"&token="+sessionStorage.getItem("token")).then(res=>{
						_this.page=res.data.page;
						_this.totalPage=res.data.totalPage;
						_this.totals=res.data.totals;
						if(this.flag==1){
							_this.drugs = res.data.drugs;
							this.show1="block";
							this.show2="none";
							this.show3="none";
							this.show="block";
							console.log(this.drugs);
						}else if(this.flag==2){
							_this.devices = res.data.devices;
							this.show1="none";
							this.show2="block";
							this.show3="none";
							this.show="block";
							console.log(this.devices);
						}else {
							_this.libraries = res.data.libraries;
							console.log(this.libraries);
							this.show1="none";
							this.show2="none";
							this.show3="block";
							this.show="block";
						}


					})
				},
				//添加预约方法
				qurey(schedule,id){

					this.schedule=schedule;
					console.log(schedule);
					var pid=localStorage.getItem("patient");
					pid=JSON.stringify(pid).substr(11,1);
					console.log(JSON.stringify(pid));
					console.log(id);
					// var _this = this;
					// this.status="block";
					axios.get("http://localhost:8080/es_healthy/doctor/serach?did="+id+"&schedule="+schedule).then(res=>{
						if(res.data.state){
							alert(res.data.msg);
						}else{
							alert("预约失败");
						}

					})
				},


			}

		});
	</script>
</html>
